#ifndef D3DGAME_H_
#define D3DGAME_H_

/*
	* D3DGame
	* This is the base class of every D3DGame application we will be using further in the game.
	* All other classes will inherit from this class implementing the functions from this class.

	* Created by : Varun Tyagi
*/

#include "../Core/GameTimer.h"
#include "../Core/D3DUtil.h"
#include <string>

class D3DGame
{
public:

	D3DGame( HINSTANCE hInstance );
	virtual ~D3DGame();

	HINSTANCE	GetAppInstance( void );
	HWND		GetMainWindow( void );

	int run();
	
	/* Framework methods. */
	virtual void initApp( void );
	virtual void onResize( void );
	virtual void onUpdateScene( float fTimeStep );
	virtual void drawScene( void );
	virtual LRESULT msgProc( UINT msg, WPARAM wParam, LPARAM lParam );

protected:

	void initMainWindow( void );
	void initDirect3D( void );

protected:

	HINSTANCE	m_hAppInstance;
	HWND		m_hMainWnd;
	bool		m_bAppPaused;
	bool		m_bMinimize;
	bool		m_bMaximize;
	bool		m_bResizing;

	GameTimer	m_Timer;

	std::wstring	m_FrameStat;

	ID3D10Device*			m_pD3DDevice;
	IDXGISwapChain*			m_pSwapChain;
	ID3D10Texture2D*		m_pDepthStencilBuffer;
	ID3D10RenderTargetView*	m_pRenderTargetView;
	ID3D10DepthStencilView*	m_pDepthStencilView;
	ID3DX10Font*			m_pFont;

	/* Derived class should set these values in derived constructor to customize starting values. */
	std::wstring			m_sMainWndCaption;
	D3D10_DRIVER_TYPE		m_D3D10DriverType;
	D3DXCOLOR				m_ClearColor;
	int						m_iWindowWidth;
	int						m_iWindowHeight;
};


#endif